g05eaf

g05eaf © Numerical Algorithms Group, 2002.

Purpose

G05EAF Set up reference vector for multivariate Normal distribution

Synopsis

[r,ifail] = g05eaf(a,c<,epslon,ifail>)

Description

 
 When the covariance matrix is non-singular (i.e., strictly 
 positive-definite), the distribution has probability density 
 function
 
                        _________   
                       /    -1      
                      /   |C  |     {      T -1     }
             f(x)=   /   --------exp{-(x-a) C  (x-a)}
                    /           n   
                  \/     (2(pi))    
 
 where n is the number of dimensions, C is the covariance matrix, 
 a is the vector of means and x is the vector of positions.
 
 Covariance matrices are symmetric and positive semi-definite. 
 Given such a matrix C, there exists a lower triangular matrix L 
             T                             
 such that LL =C. L is not unique, if C is singular.
 
 G05EAF decomposes C to find such an L. It then stores n, a and L 
 in the reference vector r for later use by G05EZF. G05EZF 
 generates a vector x of independent standard Normal pseudo-random
 numbers. It then returns the vector a+Lx, which has the required 
 multivariate Normal distribution.
 
 It should be noted that this routine will work with a singular 
 covariance matrix C, provided C is positive semi-definite, 
 despite the fact that the above formula for the probability 
 density function is not valid in that case. 
 

Parameters

g05eaf

Required Input Arguments:

a (:)                                 real
c (:,:)                               real

Optional Input Arguments:                       <Default>

epslon                                real     eps
ifail                                 integer  -1

Output Arguments:

r (:)                                 real
ifail                                 integer